<actwin> : Activate Window
Activates specified window. If the window doesn't exist a macro can be started (to open desired application or notify user, for example).
Syntax:
<actwin>("WinTitleOrHWND", Match, WindowState, "MacroRun")
WinTitleOrHWND
Title of the window to activate or HWND. HWND is a unique handle
Windows internally uses to identify each window. The HWND can be retrieved
by some commands (<wininfo>, <win_enumerate>) or is provided by some system
variables (_vKeybdFocusWindow_HWND, _vActiveWindow_HWND, _vActiveWindowPrev_HWND).
Match
Takes effect only if a window title is used as WinTitleOrHWND
parameter. Can be one of these values:
0 - WinTitle can be substring of a window title
1 - WinTitle must exactly match a window title
WindowState
Desired state of the window after the window is activated:
0 - Normal
1 - Minimized
2 - Maximized
3 - Let the state unchanged
MacroRun
Name of the macro to run if the WinTitle doesn't match any existing window.
The "no" value means no macro will be run.
Example:
<#> This macro activates "Notepad" window if it is
opened
<#>
<cmds>
<if_win>("Notepad","OPEN",0)
<actwin>("Notepad",0,0,"no")
<else>
<msg>(100,100,"'Notepad' is not opened!","Message",1)
<endif>